<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>后台管理系统</title>
    <meta name="author" content="DeathGhost"/>
    <link rel="stylesheet" type="text/css" href="/admin/css/style.css">
    <!--[if lt IE 9]>
    <script src="/admin/js/html5.js"></script>
    <![endif]-->
    <script src="/admin/js/jquery.js"></script>
    <script src="/admin/js/jquery.mCustomScrollbar.concat.min.js"></script>
    <script>
        (function ($) {
            $(window).load(function () {

                $("a[rel='load-content']").click(function (e) {
                    e.preventDefault();
                    var url = $(this).attr("href");
                    $.get(url, function (data) {
                        $(".content .mCSB_container").append(data); //load new content inside .mCSB_container
                        //scroll-to appended content
                        $(".content").mCustomScrollbar("scrollTo", "h2:last");
                    });
                });

                $(".content").delegate("a[href='top']", "click", function (e) {
                    e.preventDefault();
                    $(".content").mCustomScrollbar("scrollTo", $(this).attr("href"));
                });

            });
        })(jQuery);
    </script>
</head>
<body>
<!--header-->
<header>
    <div th:replace="admin/topBar::heater"></div>
</header>
<!--aside nav 开始-->

<aside class="lt_aside_nav content mCustomScrollbar">
    <div th:replace="admin/leftBar::left"></div>
</aside>
<!--aside nav结束-->
<div class="rt_content">
    <div class="page_title">
        <h2 class="fl">评论</h2>
    </div>
    <table class="table">
        <tr>
            <th>评论人</th>
            <th>评论内容</th>
            <th>评论时间</th>
            <th>评论状态</th>
            <th>用户账号</th>
            <th>操作</th>
        </tr>

        <div th:if="${goods != null}" th:each="comment : ${goods.goodsComments}">
            <tr>
                <td th:text="${comment.userName}">1</td>
                <td th:text="${comment.commentContent}">你好世界</td>
                <td th:text="${#dates.format(comment.commentTime, 'yyyy-MM-dd HH:mm:ss')}">123</td>
                <td th:text="${comment.commentState.commentState}">123</td>
                <td th:text="${comment.userAccount}">123456</td>
                <td>
                    <a th:if="${comment.commentState.commentStateId==2}"
                       th:href="@{/Commodity/UpdateState(commentId=${comment.commentId},commentState=1)}"><span>封禁</span></a>
                    <a th:if="${comment.commentState.commentStateId==1}"
                       th:href="@{/Commodity/UpdateState(commentId=${comment.commentId},commentState=2)}"><span>解封</span></a>
                </td>
            </tr>
        </div>
        <div th:if="${goods == null}">
            <tr>
                <td>1</td>
                <td>你好世界</td>
                <td>123</td>
                <td>123</td>
                <td>123456</td>
                <td>
                    <a><span>封禁</span></a>
                    <a><span>解封</span></a>
                </td>
            </tr>
        </div>
    </table>
</div>
</section>
</body>
</html>